﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace LibreriaDB
{
    public class LibreriaConnection
    {
        private SqlConnection _connection;

        public LibreriaConnection()
        {

        }

        public LibreriaConnection(string conexion)
        {
            this._connection = new SqlConnection(conexion);
            
        }

        public SqlConnection Getconnection()
        {
            if ((_connection != null) && (!string.IsNullOrEmpty(_connection.ConnectionString)))
            {
                return _connection;

            }
            else
            {
                throw new Exception("Conexion fallida");

            }
        }




    }
}
